
let lib_success = {

    //获取跳转地址
    jmp_url: function (jmp_url) {
        const activity_id = this.get_param('activity_id')
        const channel = this.get_param('channel')
        const channel_name = this.get_param('channel_name')
        const tids = this.get_param('tids')
        const path = '?activity_id=' + activity_id + '&channel=' + channel
            + '&tids=' + tids + (channel_name ? '&channel_name=' + channel_name : '')
        if (jmp_url == 1) {
            //帮朋友报名
            return '/success/friend' + path
        } else if (jmp_url == 2) {
            //置换二手车
            return '/success/replace' + path
        } else if (jmp_url == 3){
            //邮寄门票和补充二手车
            return '/success/ticket' + path
        } else {
            //报名成功页面
            return '/success/success' + path
        }
    },

    //获取当前链接参数
    get_param(k) {
        let pages = getCurrentPages(); // 获取页面指针数组
        let currentPage = pages[pages.length - 1]; // 获取当前页
        let options= currentPage.options;
        const get_param = options[k]
        
        return get_param
        
    }

};
export default lib_success
